Skip to main content

iphoneSetRedrawInterval

Type

command

Summary

Synchronizes LiveCode redraws with the device's refresh rate.

Syntax

iphoneSetRedrawInterval <frameInterval>

Description

Use the iphoneSetRedrawInterval command to improve screen update performance and smoothness on iOS devices by tying LiveCode redraw calls to the device's refresh rate.

By default, LiveCode updates the screen immediately after any command that requires it. This means that several small screen updates may occur in quick succession when animation is combined with other dynamic screen elements. On mobile devices this can affect smoothness of animation where it would be better if multiple frequent redraws were replaced with a single periodic redraw. Setting the iphoneSetRedrawInterval enables this behaviour, where the screen is updated at a fixed interval tied to iOS's redraw rate.

WHEN TO USE This feature should be used for applications that cause the screen to be redrawn often or where redraws are being called by various application elements. For example, scrollers, dragging and the move command all independently request redraws causing a build up which can lead to 'judders' and other unwanted drawing issues.

warning

When using this feature, updates do not occur after each command.

warning

This feature should not be used if your scripts prevent system messages from being processed. For example, tight loops using the wait command. Screen redraws are dependent on LiveCode receiving iOS redraw calls.

Parameters

NameTypeDescription

frameInterval

enum

A number specifying how often LiveCode should update the screen in line with the screen's refresh rate.

Examples

iphoneSetRedrawInterval 1 -- Redraw with every iOS redraw request
iphoneSetRedrawInterval 2 -- Redraw on every other iOS redraw request
iphoneSetRedrawInterval 0 -- Don't use the redraw interval feature

property: compositorTileSize, layerMode, compositorType, compositorCacheLimit

Compatibility and Support

Introduced

LiveCode 5.0

OS

ios

Platforms

mobile

Thank you for your feedback!

Was this page helpful?